#ifndef __P_NET_ACCEPT_ADAPTER_H__
#define __P_NET_ACCEPT_ADAPTER_H__

#include <zlib/eventsystem/Continuation.h>
#include "I_UnixNet.h"

class NetAcceptAction : public RefCountObj
{
public:
  Action action;
};

class NetAcceptAdapter : public Continuation
{
public:
	Server server;
  Ptr<NetAcceptAction> netAccept_Action;
	bool fd_blocking;

	volatile int loop;

	void cancle()
	{
		loop = false;
	}

	NetAcceptAdapter *clone();
	void init_blocking_accept(const char *thread_name);

	int acceptLoopEvent(int event, void *data);

	NetAcceptAdapter();
};

#endif //__P_NET_ACCEPT_ADAPTER_H__
